<?php

    use Illuminate\Http\Request;

    /*
    |--------------------------------------------------------------------------
    | API Routes
    |--------------------------------------------------------------------------
    |
    | Here is where you can register API routes for your application. These
    | routes are loaded by the RouteServiceProvider within a group which
    | is assigned the "api" middleware group. Enjoy building your API!
    |
    */

    //Route::middleware('auth:api')->get('/user', function (Request $request) {
    ////    return $request->user();
    //    print_r('teset');die;
    //});
    $api = app('Dingo\Api\Routing\Router');
    /**
     * api接口
     */
    $api->version('v1', function($api) {


        /**
         * 商品列表
         */
        //        $api->any('/goodsList/', "App\Http\Controllers\V1\GoodsController@getGoodsList");
        //        $api->any('/cartList/', "App\Http\Controllers\V1\CartController@getCartList");
        //        $api->any('/cartCount/', "App\Http\Controllers\V1\CartController@countCart");
        //        $api->any('/getOrderSync/', "App\Http\Controllers\V1\OrderController@getOrdersBySync");
        //        $api->any('/syncPhoto/', "App\Http\Controllers\V1\PhotoController@syncPhoto");
        //        $api->any('/editGoodsName/', "App\Http\Controllers\V1\GoodsController@editGoodsName");

//        $api->post('/login/',[ 'as' => 'login','uses' => '\App\Http\Controllers\V1\AuthController@signIn']);
//        $api->post('/login/', '\App\Http\Controllers\V1\AuthController@signIn');
//        $api->post('/signUp/', '\App\Http\Controllers\V1\AuthController@signUp');
        $api->post('/getUserInfo/',['middleware' => 'api:auth'], '\App\Http\Controllers\V1\AuthController@user');

    });




